﻿using System;
using System.Collections.Generic;
using StockTrader.BusinessService.DataContract;
using System.Data;

namespace StockTrader.DAL.IDAL
{
    public interface IAllMarket
    {
        void BeginADOTransaction();
        void RollBackTransaction();
        void CommitADOTransaction();
        void Open(string connString);
        void Close();

        void InsertAllMarket(string orderNo, string side, string symbol, string price, long volume, long mVolume, string PC, string accountNo, string status, string TID, string Tno, string time);

        void InsertBackupAllmarket(DateTime transDate, string orderNo, string side, string symbol, string price, long volume, long mVolume, string PC, string accountNo, string status, string TID, string Tno, string time);

        void DeleteBackupAllMarket(DateTime transDate);

        List<int> SelectStockNoByTransDate(DateTime transDate);

        void InsertHoseMarketFromRawData(DateTime transDate);

        List<HoseMarketData> getHoseMarketOrders(DateTime fromDate, DateTime toDate, string orderNo, string side, string symbol, long HighPrice, long LowPrice, long HighQtty, long LowQtty, long HighMQtty, long LowMQtty, string PC, string accountNo, string status, string TID, string Tno, string orderType, int fromTime, int toTime, double HighVal, double LowVal, double HighmVal, double LowmVal);

        HoseMarketSummaryData getHoseMarketSummary(DateTime fromDate, DateTime toDate, string orderNo, string side, string symbol, long HighPrice, long LowPrice, string PC, string accountNo, string status, string TID, string Tno, string orderType, int fromTime, int toTime);

        List<SecuritiesCompany> getSecuritiesCompany();
        SecuritiesCompany getSecurityCompanyByTID(string TID);
        SecuritiesCompany getSecurityCompanyByShortName(string ShortName);

        void InsertDailyOrder(int firmno, DateTime transdate, string pcflag, string orderside, string symbol, int volume, int matched, int price, int time);

        void InsertDailyOrderWithAccountNo(int firmno, DateTime transdate, string pcflag, string orderside, string symbol, int volume, int matched, int price, int time, string accountno);

        List<DailyOrderData> getDailyOrder(DateTime fromdate, DateTime todate, string firmno, string pcflag, string orderside, string symbol, int lowVolume, int highVolume, int lowMVolume, int hightMVolume);

        List<DailyOrderData> getDailyOrderWithAccountNo(DateTime fromdate, DateTime todate, string firmno, string pcflag, string orderside, string symbol, int lowVolume, int highVolume, int lowMATCHED, int hightMATCHED, string accountno);

        DailyOrderSummaryData getDailyOrderSummary(DateTime fromdate, DateTime todate, string firmno, string pcflag, string orderside, string symbol, int lowVolume, int highVolume, int lowMATCHED, int hightMATCHED);

        DailyOrderSummaryData getDailyOrderSummaryWithAccountNo(DateTime fromdate, DateTime todate, string firmno, string pcflag, string orderside, string symbol, int lowVolume, int highVolume, int lowMATCHED, int hightMATCHED, string accountno);

        void DeleteDailyOrderByDate(DateTime transDate);

    }
}
